package com.ruoyi.api.service.impl;


import com.ruoyi.api.service.IFileService;
import com.ruoyi.common.utils.file.MinioUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author dqb
 * @date 2024-05-13
 */
@Service
public class FileServiceImpl implements IFileService {


    @Autowired
    private MinioUtils minioUtils;

    @Value("${minio.bucketName}")
    private String minioBucketName;


    /**
     * 上传文件
     *
     * @param file
     * @return
     */
    @Override
    public Map<String, Object> minioUploadFile(MultipartFile file) {
        //上传文件
        Map<String, Object> result = minioUtils.uploadFile(minioBucketName, file);
        return result;

    }


}
